package com.daydr3am.thenation;


import org.w3c.dom.Node;

import com.daydr3am.lib.ImageLoader;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public class DontMiss extends SubScroll {
    public DontMiss(Context ctx, AttributeSet attrs) {
		super(ctx, attrs);
		// TODO Auto-generated constructor stub
		
	}

    public void receiveData(){
		for(int i=0;i<2;i++){
			Node currentNode=list.item(i);
			if(currentNode.getChildNodes().getLength()>5){
		        LayoutInflater layoutInflater = (LayoutInflater) con.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        		View pageView = layoutInflater.inflate(R.layout.dont_miss, null);
        		this.addPage(pageView);
        		
        		TextView groupName = (TextView) findViewById(R.id.dont_section_textview);
        		TextView titleName = (TextView) pageView.findViewById(R.id.dont_title_textview);
        		ImageView img = (ImageView) findViewById(R.id.dont_thumb_imageview);
        		
        		groupName.setText(currentNode.getChildNodes().item(1).getTextContent());
        		titleName.setText(currentNode.getChildNodes().item(5).getTextContent());
        		
        		ImageLoader imgLoader = new ImageLoader(con.getApplicationContext());
        		imgLoader.DisplayImage(currentNode.getChildNodes().item(17).getTextContent(), 0, img);
			}
		}
    }
}
